#include<linux/module.h>
#include<linux/sched.h>
#include<linux/pid.h>
#include<linux/pid_namespace.h>
MODULE_LICENSE("GPL");
static int __init task_active_pid_ns_init(void)
{
	printk("into task_active_pid_ns_init.\n");
	struct pid *kpid=find_get_pid(current->pid);
	struct task_struct *task=pid_task(kpid,PIDTYPE_PID);
	struct pid_namespace *ns=task_active_pid_ns(task);

	printk("the pid of the find_get_pid result is :%d\n",kpid->numbers[kpid->level].nr);

	printk("the last_pid of the task_active_pid_ns result is:%d\n",ns->last_pid);
	printk("the pid of current thread is :%d\n",current->pid);
	printk("out task_active_pid_ns_init.\n");
	return 0;
}
static void __exit task_active_pid_ns_exit(void)
{
	printk("Goodbye task_active_pid_ns\n");
}
module_init(task_active_pid_ns_init);
module_exit(task_active_pid_ns_exit);
